<include file="public@header" />
<style type="text/css">

    .form-horizontal .control-label {width:150px;}
    input{width:100%; min-width:210px;}
</style>
<script type="text/javascript" src="__STATIC__/js/gaopaiyi/gpy.js?v={:time()}"></script>
</head>
<body onload="onLoad(1)">
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">

        <li><a href="{:url('orders/visua')}">{:lang('可视化墓区')}</a></li>
        <li><a href="{:url('deposit/tomb_deposit')}?order_id={$order_id}">格位信息</a></li>
        <li class="active"><a href="">寄存人信息</a></li>
    </ul>
    <form class="form-horizontal ajax-form" action="{:url('deposit_applyer')}" method="post">
        <input type="hidden" name="order_id" value="{$order_id}" >
        <input type="hidden" name="customer_id" value="{$result.id|default=''}" >
        <fieldset>
            <div class="control-group1-p" style="border:1px solid #e2e2e2; padding-top:20px;">
                <div class="form-group">
                    <label class="control-label" style="width: 190px;"><span class="form-required">*</span>客户账户（身份证号码）</label>
                    <div class="col-lg-2" style="width: 18%;">
                        <input type="text" class="form-control" id="customer_account" name="customer_account" placeholder="请输入身份证号码" value="{$result.customer_account|default=''}" >
                        <button type="button"  class=" btn btn-info " id="singleReadIDCard"  >读取</button>

                    </div>
                    <input type="hidden" id="buyer_sex" name="buyer_sex" value="{$result.buyer_sex|default=''}">
                    <label class="control-label" style="width: 125px"><span class="form-required">*</span>证件类型</label>
                    <div class="col-lg-2">
                        <select name="cart_type" class="form-control">
                            <if condition=" isset($result['cart_type'])">
                                <option value="1" <if condition=" $result['cart_type'] eq 1"> selected </if>>身份证</option>
                                <option value="2" <if condition=" $result['cart_type'] eq 2"> selected </if>>护照</option>
                                <option value="3" <if condition=" $result['cart_type'] eq 3"> selected </if>>军人证</option>
                                <else/>
                                <option value="1">身份证</option>
                                <option value="2">护照</option>
                                <option value="3">军人证</option>
                            </if>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label" style="width: 190px;"><span class="form-required">*</span>寄存人</label>
                    <div class="col-lg-2">
                        <input type="text" class="form-control" name="buyer_name" id="buyer_name" value="{$result.buyer_name|default=''}"  placeholder="请输入注册人姓名（2-6字符）">
                    </div>
                    <label class="control-label"><span class="form-required">*</span>联系电话</label>
                    <div class="col-lg-2">
                        <input type="text" class="form-control" name="buyer_phone" id="buyer_phone" value="{$result.buyer_phone|default=''}" placeholder="请输入注册人联系电话">
                    </div>
                    <div class="col-lg-3">
                        <php>$img_url=cmf_get_image_preview_url(isset($result['cart_upload'])?$result['cart_upload']:'');</php>
                        <input type="hidden" name="cart_upload_id" id="cart_upload-file_id" value="{$result.cart_upload_id|default=''}">
                        <input type="hidden" name="cart_upload" id="cart_upload" value="{$result.cart_upload|default=''}">
                        <a href="javascript:gpyUploadOneImage('上传身份证', '#cart_upload','{$tomb_num}');">
                            <h5 class="btn btn-primary">上传身份证</h5>
                        </a>
                        <img   style="width: 36px"   src="{$img_url}" onclick="parent.imagePreviewDialog(this.src);" class="preview" id="cart_upload-preview" />
                    </div>
                </div>
                <div class="form-group ">
                    <label class="control-label" style="width: 190px;"><span class="form-required">*</span>逝者</label>
                    <div class="col-sm-2">
                        <input type="text" class="form-control" name="purchased_name"  value="{$result.purchased_name|default=''}"  placeholder="请输入墓主姓名（2-6字符）">
                    </div>
                    <label class="control-label"></label>
                    <div class="col-sm-2">
                    </div>
                    <div class="col-sm-3">
                        <php>$img_urls=cmf_get_image_preview_url(isset($result['purchased_file'])?$result['purchased_file']:'');</php>
                        <input type="hidden" name="purchased_file_id" id="purchased_file-file_id" value="{$result.purchased_file_id|default=''}">
                        <input type="hidden" name="purchased_file" id="purchased_file" value="{$result.cart_upload|default=''}">
                        <a href="javascript:gpyUploadOneImage('火化证明', '#purchased_file','{$tomb_num}');">
                            <h5  class="btn btn-primary">火化证明</h5>
                        </a>
                        <img  style="width: 36px"   src="{$img_urls}"onclick="parent.imagePreviewDialog(this.src);"  class="preview" id="purchased_file-preview" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="control-label"style="width: 190px;"><span class="form-required">*</span>第二联系人</label>
                    <div class="col-lg-2">
                        <input type="text" class="form-control" name="second_name" id="second_name" value="{$result.second_name|default=''}"  placeholder="请输入名称（2-6字符）">
                        <input type="hidden" class="form-control" name="cart_ID"   value="{$result.cart_ID|default=''}"  >
                    </div>
                    <label class="control-label"><span class="form-required">*</span>第二联系人号码</label>
                    <div class="col-lg-2">
                        <input type="text" class="form-control" name="second_phone" id="second_phone" value="{$result.second_phone|default=''}" placeholder="请输入第二联系电话">
                    </div>
                </div>
                <div class="form-group" style="width:100%;">
                    <label class="control-label"style="width: 190px;">客户详细地址</label>
                    <div class="col-lg-4">
                        <input type="text" style="min-width: 100%;" class="form-control" id="customer_address" name="customer_address" value="{$result.customer_address|default=''}" placeholder="请输入详细地址信息" >
<!--                        <textarea name="customer_address" class="form-control" rows="4" style="width:595px; text-align:left;" placeholder="请输入详细地址信息">{$result.customer_address|default=''}</textarea>-->
                    </div>
                    <label class="control-label">导购员</label>
                    <div class="col-lg-4" style="">
                        <input type="text" class="form-control" value="{$result.shoppingguide|default=''}"  disabled>
                    </div>

                </div>
                <div class="form-group" >
                </div>
            </div>
        </fieldset>
        <div class="form-actions">{$result.customer_id|default=''}
            <button type="submit" class="quan btn btn-primary ajax-submit">提交</button>
        </div>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js?v={:time()}"></script>
<script>
    $('#singleReadIDCard').click(function () {
        ReadIDCard(1,function (json) {
            console.log(json)
            $('#customer_account').val(json.empIndentity);
            $('#buyer_name').val(json.empName);
            $('#customer_address').val(json.empRegisteredPlace);
            $('#buyer_sex').val(json.empSex);

            $.ajax({
                url: "{:url('user/asset/gaopaiyi')}",
                type: 'post',
                data:{path:"{$tomb_num}",pathbase64:json.fileBase64},
                success: function (data) {
                    if (data.code==1){
                        $('#cart_upload').val( data.data.filepath);
                        $('#cart_upload-preview').attr('src', data.data.preview_url);
                    }
                }
            })
        })
    })
    $('.dingjin').click(function () {
        $('input[name=dtype]').val(1)
    })
    $('.quan').click(function () {
        $('input[name=dtype]').val(0)
    })
</script>
</body>
</html>